package com.gnkexy.springframework.context.event;

import com.gnkexy.springframework.beans.factory.support.BeanFactory;
import com.gnkexy.springframework.context.ApplicationEvent;
import com.gnkexy.springframework.context.ApplicationListener;

import java.util.Collection;

public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster {

    public SimpleApplicationEventMulticaster(BeanFactory beanFactory) {

    }

    @Override
    public void multicastEvent(ApplicationEvent event) {
        Collection<ApplicationListener> applicationListeners = getApplicationListeners(event);
        for (ApplicationListener applicationListener : applicationListeners) {
            applicationListener.onApplicationEvent(event);
        }
    }
}
